// 菜品查询、点菜操作、全单操作相关api
import http from '@/utils/http'

// key对应函数名，value对应api地址
const apiFormData = {
  feachacheList: 'shopFood/cacheList',
  // 菜品列表
  fetchFoodList: 'shopFood/list',
  // 菜品分类列表
  fetchfoodCategoryList: 'shopFood/foodCategory',
  // 菜品口味列表
  fetchTasteList: 'shopFood/tasteList',
  // 菜谱列表
  fetchMenuList: 'shopFood/menuList',
  // 创建订单
  deskOrderAdd: 'deskOrder/add',
  // 加菜---新点方式
  deskOrderAddFood: 'deskOrder/addFood',
  // 菜品套餐列表
  foodGroupList: 'shopFood/groupList',
  // 加菜---直接增加菜品数量
  deskOrderAddFoodNum: 'deskOrder/addFoodNum',
  // 套餐菜品组菜品列表
  fetchFoodListOfItem: 'shopFood/getFoodListOfItem',
  // 获取菜品组列表
  fetchFoodItemList: 'shopFood/getItemList',
  // 菜品操作-催菜
  orderFoodHurry: 'orderFood/hurry',
  // 菜品操作-等叫
  orderFoodWait: 'orderFood/wait',
  // 菜品操作-退菜
  orderFoodBack: 'orderFood/back',
  // 菜品操作-赠送
  orderFoodPresent: 'orderFood/present',
  // 菜品操作-撤销赠送
  orderFoodUnpresent: 'orderFood/unPresent',
  // 菜品操作-起菜（重打）
  orderFoodStart: 'orderFood/start',
  // 全单催菜
  orderHurry: 'deskRecord/orderHurry',
  // 全单等叫
  orderWait: 'deskRecord/orderWait',
  // 全单起菜
  orderStart: 'deskRecord/orderStart',
  // 全单赠送
  orderPresent: 'deskRecord/orderPresent',
  // 全单撤销赠送
  unOrderPresent: 'deskRecord/unOrderPresent',
  // 全单打折
  allOrderDiscount: 'deskRecord/editOrderDiscount',
  // 全单上齐（全桌上菜）
  allFoodOrderServe: 'deskRecord/orderServe',
  // 菜品口味分类列表
  tasteCategoryList: 'shopFood/tasteCategoryList',
  // 菜品做法列表
  fetchMakingList: 'shopFood/makingList',
  // 菜品做法分类列表
  makingCategoryList: 'shopFood/makingCategoryList',
  // 菜品菜谱分类
  menuCategoryList: 'shopFood/menuCategoryList',
  // 菜谱下面的菜品列表
  menuFoodList: 'shopFood/menuFoodList',
  // 获取菜品下面的配菜列表
  foodExtraList: 'shopFood/extraList',
  // 获取当前菜品下面的套餐详情（创建订单之前）
  foodGroupDetail: 'shopFood/foodgroupDetail',
  // type 类型 10：退菜原因   20：赠菜原因
  foodReasonList: 'food_reason/list',
  // 修改单品的菜品折扣
  orderFoodDiscountEdit: 'orderFood/edit',
  // 菜品席数调整
  orderFoodDeskEdit: 'orderFood/foodDeskEdit',
  // 订单生成菜谱列表回显
  orderMenuFoodList: 'shopFood/orderMenuFoodList',
  // 订单生成菜谱列表回显
  orderMenuFoodAdd: 'shopFood/orderMenuFoodAdd',
  // 起菜重打【包含全单操作和单菜操作】
  foodStartTicketPrint: 'orderFood/foodStartTicket',
  // 修改套餐里面的菜品数量
  orderFoodgroupFoodEditNum: 'orderFood/orderFoodgroupFoodEditNum',
  // 修改当前菜品价格
  orderFoodEditPrice: 'orderFood/editPrice',
  /**
   * 菜品列表专用缓存列表
   * item.extra_list(配菜列表)
    item.skuList.foodgroup_detail(套餐信息)
   * */
  fetchCacheFoodList: 'shopFood/cacheList',
  /**
   * 菜谱列表列表专用缓存列表
   * item.menu_detail(菜谱详情)
   * */
  fetchCacheMenuList: 'shopFood/cacheMenuList',
  // 缓存菜品的口味分类专用
  cacheTasteCategoryList: 'shopFood/cacheTasteCategoryList',
  // 上报菜品状态
  reportOrderState: 'orderFood/serveList',
  // 多台开席
  openMulDesk: 'desk/openMostDesk',

  // writeFoodList
  writeFoodList: 'shopFood/writeFoodList',

  // 接口添加手写菜品
  addWriteFood: 'deskOrder/addFood'
}

export function openMulDesk(data: any) {
  return http({
    url: apiFormData.openMulDesk,
    method: 'post',
    data
  })
}
export function fetchFoodList(params: any) {
  return http({
    url: apiFormData.fetchFoodList,
    method: 'get',
    params
  })
}

export function fetchfoodCategoryList(params: any) {
  return http({
    url: apiFormData.fetchfoodCategoryList,
    method: 'get',
    params
  })
}

export function fetchTasteList(params: any) {
  return http({
    url: apiFormData.fetchTasteList,
    method: 'get',
    params
  })
}

export function fetchMenuList(params: any) {
  return http({
    url: apiFormData.fetchMenuList,
    method: 'get',
    params
  })
}

export function deskOrderAdd(data: any) {
  return http({
    url: apiFormData.deskOrderAdd,
    method: 'post',
    data
  })
}

export function deskOrderAddFood(data: any) {
  return http({
    url: apiFormData.deskOrderAddFood,
    method: 'post',
    data
  })
}

export function foodGroupList(params: any) {
  return http({
    url: apiFormData.foodGroupList,
    method: 'get',
    params
  })
}

export function deskOrderAddFoodNum(data: any) {
  return http({
    url: apiFormData.deskOrderAddFoodNum,
    method: 'post',
    data
  })
}

export function fetchFoodListOfItem(params: any) {
  return http({
    url: apiFormData.fetchFoodListOfItem,
    method: 'get',
    params
  })
}

export function fetchFoodItemList(params: any) {
  return http({
    url: apiFormData.fetchFoodItemList,
    method: 'get',
    params
  })
}

export function orderFoodHurry(data: any) {
  return http({
    url: apiFormData.orderFoodHurry,
    method: 'post',
    data
  })
}

export function orderFoodWait(data: any) {
  return http({
    url: apiFormData.orderFoodWait,
    method: 'post',
    data
  })
}

export function orderFoodBack(data: any) {
  return http({
    url: apiFormData.orderFoodBack,
    method: 'post',
    data
  })
}

export function orderFoodPresent(data: any) {
  return http({
    url: apiFormData.orderFoodPresent,
    method: 'post',
    data
  })
}

export function orderFoodUnpresent(data: any) {
  return http({
    url: apiFormData.orderFoodUnpresent,
    method: 'post',
    data
  })
}

export function orderFoodStart(data: any) {
  return http({
    url: apiFormData.orderFoodStart,
    method: 'post',
    data
  })
}

export function orderHurry(data: any) {
  return http({
    url: apiFormData.orderHurry,
    method: 'post',
    data
  })
}

export function orderWait(data: any) {
  return http({
    url: apiFormData.orderWait,
    method: 'post',
    data
  })
}

export function orderStart(data: any) {
  return http({
    url: apiFormData.orderStart,
    method: 'post',
    data
  })
}

export function orderPresent(data: any) {
  return http({
    url: apiFormData.orderPresent,
    method: 'post',
    data
  })
}

export function unOrderPresent(data: any) {
  return http({
    url: apiFormData.unOrderPresent,
    method: 'post',
    data
  })
}

export function allOrderDiscount(data: any) {
  return http({
    url: apiFormData.allOrderDiscount,
    method: 'post',
    data
  })
}

export function allFoodOrderServe(data: any) {
  return http({
    url: apiFormData.allFoodOrderServe,
    method: 'post',
    data
  })
}

export function tasteCategoryList(params: any) {
  return http({
    url: apiFormData.tasteCategoryList,
    method: 'get',
    params
  })
}

export function fetchMakingList(params: any) {
  return http({
    url: apiFormData.fetchMakingList,
    method: 'get',
    params
  })
}

export function makingCategoryList(params: any) {
  return http({
    url: apiFormData.makingCategoryList,
    method: 'get',
    params
  })
}

export function menuCategoryList(params: any) {
  return http({
    url: apiFormData.menuCategoryList,
    method: 'get',
    params
  })
}

export function menuFoodList(params: any) {
  return http({
    url: apiFormData.menuFoodList,
    method: 'get',
    params
  })
}

export function foodExtraList(params: any) {
  return http({
    url: apiFormData.foodExtraList,
    method: 'get',
    params
  })
}

export function foodGroupDetail(params: any) {
  return http({
    url: apiFormData.foodGroupDetail,
    method: 'get',
    params
  })
}

export function foodReasonList(params: any) {
  return http({
    url: apiFormData.foodReasonList,
    method: 'get',
    params
  })
}

export function orderFoodDiscountEdit(data: any) {
  return http({
    url: apiFormData.orderFoodDiscountEdit,
    method: 'post',
    data
  })
}

export function orderFoodDeskEdit(data: any) {
  return http({
    url: apiFormData.orderFoodDeskEdit,
    method: 'post',
    data
  })
}

export function orderMenuFoodList(params: any) {
  return http({
    url: apiFormData.orderMenuFoodList,
    method: 'get',
    params
  })
}

export function orderMenuFoodAdd(data: any) {
  return http({
    url: apiFormData.orderMenuFoodAdd,
    method: 'post',
    data
  })
}

export function foodStartTicketPrint(data: any) {
  return http({
    url: apiFormData.foodStartTicketPrint,
    method: 'post',
    data
  })
}

export function orderFoodgroupFoodEditNum(data: any) {
  return http({
    url: apiFormData.orderFoodgroupFoodEditNum,
    method: 'post',
    data
  })
}

export function orderFoodEditPrice(data: any) {
  return http({
    url: apiFormData.orderFoodEditPrice,
    method: 'post',
    data
  })
}

export function fetchCacheFoodList(params: any) {
  return http({
    url: apiFormData.fetchCacheFoodList,
    method: 'get',
    params
  })
}

export function fetchCacheMenuList(params: any) {
  return http({
    url: apiFormData.fetchCacheMenuList,
    method: 'get',
    params
  })
}

export function cacheTasteCategoryList(params: any) {
  return http({
    url: apiFormData.cacheTasteCategoryList,
    method: 'get',
    params
  })
}

export function reportOrderState(data: any) {
  return http({
    url: apiFormData.reportOrderState,
    method: 'post',
    data
  })
}


export function feachacheList(params: any) {
  return http({
    url: apiFormData.feachacheList,
    method: 'get',
    params
  })
}


export  function writeFoodList() {
  return http({
    url: apiFormData.writeFoodList,
    method: 'get'
  })
}

export function addWriteFood(data: any) {
  return http({
    url: apiFormData.addWriteFood,
    method: 'post',
    data
  })
}